<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="利润表打印" />
<%@ include file="../inc/PrintTitle.jsp"%>
<head>
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doCancel(){
		window.close();
	}
	function doPrint(){
		ShowConfirm('确认框','确定开始打印吗？',340,80,"doPrintCallBack()");
	}
	function doPrintCallBack(){
		if(popRetVal!=null){
			document.getElementById("noPrinSpan").style.display="none";
			printContent("管理易-利润表","${enterpriseInfo.doPrint}","${enterpriseInfo.printWidth}");
			document.getElementById("noPrinSpan").style.display="";
		}
	}
</script>
</head>
<body style="background-color:#FFFFFF">
<table width="100%" border="0"  align="center" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td height="40px" align="center" class="FontLarge_Bold">${licenseInfo.enterpriseName} 利润表</td>
				</tr>
		  </table>
		</td>
	</tr>
	<tr>
		<td height="5"></td>
	</tr>	
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="ListTable">
				<tr class="ListTrPrint">
			      	<td class="FontSmall" >
						统计范围：
						<c:if test="${tsId==null || tsId=='' || tsId=='0'}">全部帐套</c:if>
						<c:if test="${tsId!=null && tsId!='' && tsId!='0'}"><commonTag:showSimpleObjectName list="${tallySetList}" objectId="${tsId}" /></c:if>
						&nbsp;&nbsp;
						起止日期：${startDate}至${endDate}
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="small_border">
				<tr class="ListTrPrint">
			      	<td class="FontSmall" colspan="2" >
						&nbsp;&nbsp;利润：${proTotal}元&nbsp;&nbsp;
						利润率：<strong>${proPercent}%</strong>&nbsp;&nbsp;
						营业收入合计：${inTotal}元&nbsp;&nbsp;
						营业支出合计：${outTotal}元
					</td>
				</tr>			
				<tr class="ListTrPrint">
					<td width="50%" class="FontSmall" align="left">&nbsp;&nbsp;营业收入：${inTotal}</td>
					<td width="50%" class="FontSmall" align="left">
						<table width="100%">
							<tr class="FontSmall">
								<td style="border:0px" width="70%"><div align="left">&nbsp;&nbsp;营业支出：${outTotal}</div></td>
								<td style="border:0px" width="30%"><div align="right">${outTotalPer}%</div></td>
							</tr>
						</table>
					</td>
				</tr>
				
				<c:if test="${type=='REC'}">
				<tr class="ListTrPrint">
					<td class="FontSmall" align="left" rowspan="2" valign="top">
						&nbsp;&nbsp;------&nbsp;销售收入：${salTotal}
						<c:forEach var="item" items="${salList}"><br/>&nbsp;&nbsp;------------&nbsp;${item[2]}：${item[0]}</c:forEach>
					</td>
					<td class="FontSmall" align="left" valign="top">
						<table width="100%">
							<tr class="FontSmall">
								<td style="border:0px" width="70%">
									<div align="left">
										&nbsp;&nbsp;------&nbsp;材料支出：${mateTotal}
									</div>
								</td>
								<td style="border:0px" width="30%"><div align="right">${mateTotalPer}%</div></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr class="ListTrPrint">
					<td class="FontSmall" align="left" valign="top">
						<table width="100%">
							<tr class="FontSmall">
								<td style="border:0px" width="70%">
									<div align="left">
										&nbsp;&nbsp;------&nbsp;外协支出：${cooTotal}
									</div>
								</td>
								<td style="border:0px" width="30%"><div align="right">${cooTotalPer}%</div></td>
							</tr>
							<c:forEach var="item" items="${cooList}">
							<tr class="FontSmall">
								<td style="border:0px" width="70%">
									<div align="left">&nbsp;&nbsp;------------&nbsp;${item[2]}：${item[0]}</div>
								</td>
								<td style="border:0px" width="30%"><div align="right">${item[3]}%</div></td>
							</tr>
							</c:forEach>
						</table>
					</td>
				</tr>
				<tr class="ListTrPrint">
					<td class="FontSmall" align="left" valign="top">
						&nbsp;&nbsp;------&nbsp;其他收入小计：${incCost}
						<c:forEach var="item" items="${incList}"><br/>&nbsp;&nbsp;------------&nbsp;${item[2]}：${item[0]}</c:forEach>
					</td>
					<td class="FontSmall" align="left" valign="top">
						<table width="100%">
							<tr class="FontSmall">
								<td style="border:0px" width="70%">
									<div align="left">
										&nbsp;&nbsp;------&nbsp;费用小计：${feeCost}
									</div>
								</td>
								<td style="border:0px" width="30%"><div align="right">${feeTotalPer}%</div></td>
							</tr>
							<c:forEach var="item" items="${feeList}">
							<tr class="FontSmall">
								<td style="border:0px" width="70%">
									<div align="left">&nbsp;&nbsp;------------&nbsp;${item[2]}：${item[0]}</div>
								</td>
								<td style="border:0px" width="30%"><div align="right">${item[3]}%</div></td>
							</tr>
							</c:forEach>
						</table>
					</td>
				</tr>
				</c:if>
				
				<c:if test="${type=='BILL'}">
				<tr class="ListTrPrint">
					<td class="FontSmall" align="left" valign="top">
						&nbsp;&nbsp;------&nbsp;业务：${salTotal}
					</td>
					<td class="FontSmall" align="left" valign="top">
						<table width="100%">
							<tr class="FontSmall">
								<td style="border:0px" width="70%">
									<div align="left">
										&nbsp;&nbsp;------&nbsp;材料：${mateTotal}
									</div>
								</td>
								<td style="border:0px" width="30%"><div align="right">${mateTotalPer}%</div></td>
							</tr>
							<tr class="FontSmall">
								<td style="border:0px" width="70%">
									<div align="left">
										&nbsp;&nbsp;------&nbsp;外协：${cooTotal}
									</div>
								</td>
								<td style="border:0px" width="30%"><div align="right">${cooTotalPer}%</div></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr class="ListTrPrint">
					<td class="FontSmall" align="left" valign="top">
						&nbsp;&nbsp;------&nbsp;调账：${inAdj}
					</td>
					<td class="FontSmall" align="left" valign="top">
						<table width="100%">
							<tr class="FontSmall">
								<td style="border:0px" width="70%">
									<div align="left">
										&nbsp;&nbsp;------&nbsp;调账：${outAdj}
									</div>
								</td>
								<td style="border:0px" width="30%"><div align="right">${outAdjPer}%</div></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr class="ListTrPrint">
					<td class="FontSmall" align="left" valign="top">
						&nbsp;&nbsp;------&nbsp;其他收入小计：${incCost}
						<c:forEach var="item" items="${incList}"><br/>&nbsp;&nbsp;------------&nbsp;${item[2]}：${item[0]}</c:forEach>
					</td>
					<td class="FontSmall" align="left" valign="top">
						<table width="100%">
							<tr class="FontSmall">
								<td style="border:0px" width="70%">
									<div align="left">
										&nbsp;&nbsp;------&nbsp;费用小计：${feeCost}
									</div>
								</td>
								<td style="border:0px" width="30%"><div align="right">${feeTotalPer}%</div></td>
							</tr>
							<c:forEach var="item" items="${feeList}">
							<tr class="FontSmall">
								<td style="border:0px" width="70%">
									<div align="left">&nbsp;&nbsp;------------&nbsp;${item[2]}：${item[0]}</div>
								</td>
								<td style="border:0px" width="30%"><div align="right">${item[3]}%</div></td>
							</tr>
							</c:forEach>
						</table>
					</td>
				</tr>
				</c:if>
		  </table>
		</td>
	</tr>
	
	<tr>
		<td height="3"></td>
	</tr>
	<tr id="noPrinSpan">
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td>
						<input type="button" id="printButton" class="Button" value="开始打印 " onClick="doPrint();">
						<input type="button" id="cancelButton" class="Button" value=" 退 出 " onClick="doCancel();">
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>